import request from "@/utils/request"

// 请求参数类型
export type ProbParamsType = {
    "id": number | null,
    "questionType": number | null,
    "level": number | null,
    "subjectId": number | null,
    "pageIndex": number,
    "pageSize": number
}
// 
type ProbResponseType<T> = {
    total: number,
    list: T[]
}


export type ProbItemType = {
   id: number;
   subjectId: number;
}

// 返回值类型
export type ProbType = {
    id: number | null;
    name: string;
    level: number;
    levelName: string
}

// 题目列表接口
export function probPage(data: ProbParamsType) {    
    return request.post<ProbResponseType<ProbItemType>>("/api/admin/question/page", data)
}

type SubjectItemType = {
    deleted:boolean;
    id: number;
    itemOrder: null;
    level: number;
    levelName: string;
    name: string;
}

//学科列表
export function subjectList() {
    return request.post<SubjectItemType[]>("/api/admin/education/subject/list")
}
